#include<Windows.h>
#include<Winbase.h>
#include<string>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<climits>
#include"logger.h"
#include<cstdio>

static __int64 VIEW_SIZE = 67108864;
static __int64 MIN_VIEW_SIZE = 8388608;

class File{
public:
	char *file_name;
	HANDLE hFile;
	HANDLE hFileMap;
	HANDLE hMapData;
	HANDLE ptr;
	int FILE_FORMAT;
	__int64 view_size;
	__int64 size;
	__int64 offset;
	File();
	File(char *file_name, int FILE_FORMAT);
	File(char *file_name, __int64 _size, int FILE_FORMAT);
	//~File();
	long int next();
	std::vector<File> split();
	long int getLongInt(char *);
	char *findDelim(char *);
	long int operator[] (__int64 );
	void sortTo(char *file_name);
	int write(long int);
	void FreeResourses();
	void createFile(char *file_name, __int64 size, int FILE_FORMAT);
	int fill();
};